<?php
namespace PsiFramework\Classes\Actions\Install;

import("Classes.Actions.AbstractAction");

use \PsiFramework\Classes\Actions\AbstractAction;

/**
 * PsiFramework
 * Php Simple Framework
 *
 * @author Rémi San
 * @version beta
 */

/**
 * Classe d'action de création d'objets
 *
 * @package Actions.Install
 */
class CreateObjectAction extends AbstractAction
{

    /**
     * The main function of the method which is called every time
     * an action is created by the front controller.
     *
     */
    public function execute()
    {
        parent::execute();

        $attributes = array(array("name"=>"id", "type"=>"int"));
        $types = array(
            "int",
            "string",
            "User",
            "City",
            "Subdivision",
            "Country",
            "Gender"
        );

        $this->_response->setAttribute("types", $types);
        $this->_response->setAttribute("attributes", $attributes);

        $this->_templateManager->addTemplate(
            "main/create_object",
            $this->_response
        );
    }
}
